<?php

namespace App\Http\Controllers\user;

use App\Dao\VipOrderDao;
use App\Dao\VipSettingsDao;
use App\Services\Code;
use App\Validate\Logic\VipSettingsLogic;

/**
 * Created by PhpStorm.
 * @purpose
 * @Author: fhc
 * @Time: 2023/5/10 14:13
 */
class VipsController extends BaseController
{


    public function get_vips(): array
    {
        return Code::message('',200,VipSettingsDao::get_vips());
    }


    public function add_vip_order(VipSettingsLogic $logic): array
    {
        $post = array_merge(request()->post(),[
            'user_id'=>getUserToken()
        ]);
        $logic->add_vip_order($post);
        return Code::message('下单成功',200,VipOrderDao::add_vip_order($post));
    }

}
